package com.yhb.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WithdrawFlow {
    private String id;
    private String userId;
    private BigDecimal amount;
    private BigDecimal remitFee;
    private Status status;
    private String relatedBalanceFlowId; // 如果转为failed, 需要把这条flow删掉

    private Map<String, String> extendInfo;
    private Date createTime;
    private Date updateTime;
    private String cardId;
    private Card remitCard;

    // CREATED ---> COMMITTED ---> SUCCEED
    //                  | -------> FAILED
    public enum Status {
        CREATED,

        COMMITTED,
        SUCCEED,
        FAILED,
    }
}
